<?php

require_once( "application.php" );
require_once( "EditAppxFeature.class.php" );

$app	=	new Application();

$app->IsAuthenticationRequired(TRUE);


$editAppxFeature	=	new	EditAppxFeature();

$listview	=	 $editAppxFeature->getGrid( $editAppxFeature->rowslist ) ;



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="index, follow" />
	<meta name="keywords" content="brunom4ciel" />
	<meta name="description" content="Semantic web" />
	<meta name="generator" content="brunom4ciel" />
	<title>Bruno Maciel</title>
  
  	<link rel="stylesheet" href="css/generic.css" type="text/css" />

<script>

function parseScript(_source) {
		var source = _source;
		var scripts = new Array();
 
		// Strip out tags
		while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
			var s = source.indexOf("<script");
			var s_e = source.indexOf(">", s);
			var e = source.indexOf("</script", s);
			var e_e = source.indexOf(">", e);
 
			// Add to scripts array
			scripts.push(source.substring(s_e+1, e));
			// Strip from source
			source = source.substring(0, s) + source.substring(e_e+1);
		}
 
		// Loop through every script collected and eval it
		for(var i=0; i<scripts.length; i++) {
			try {
				eval(scripts[i]);
			}
			catch(ex) {
				// do what you want here when a script fails
			}
		}
		// Return the cleaned source
		return source;
}


function xmlhttpPost(strURL, id) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText, id);
        }
    }
    self.xmlHttpReq.send();
}

function updatepage(str, id){

	document.getElementById( id ).innerHTML = parseScript( str );
    //document.getElementById( id ).innerHTML = str;
}	
function changeFeatureApp( application_id, feature_id, idResponde ){
	
	http://localhost:8888/bifm/survey/gridAppxFeature.php?action=checked&application_id=6&feature_id=2&checked=0
	
	xmlhttpPost('http://cin.ufpe.br/'
				+ '~bifm/projeto/survey/gridAppxFeature.php?'
				+ 'action=checked'
				+ '&application_id='+application_id
				+ '&feature_id='+feature_id
				+ '', idResponde);
								
	
}	
</script>



   
   
</head>
<body class="contentpane">
<div id="response" style="width:0px;height:0px;float:left;visibility: hidden;"></div>



<a href="index.php">Home</a>	
<a href="gridAppxFeature.php"><h1>Visualizar Lista de Aplicações e Features da Web Semântica</h1> </a>
                 
	<fieldset style="width:auto;">
		
	<?php echo $listview; ?>	
	
	</fieldset>
	

</body>
</html>